home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Abalone 1.4.2 / src / Compute.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-21  |  1.6 KB  |  53 lines  |  [TEXT/MPS ]

  1. #ifndef COMPUTE_H
  2. #define COMPUTE_H
  3.  
  4.  
  5. #include "Abalone.h"
  6. #include "Board.h"
  7. #include "Rules.h"
  8. #include "Strategies.h"
  9.  
  10. #ifndef THINK_C
  11. #include <Types.h>
  12. #endif
  13.  
  14. #define    kMaxJudgeVal     30000
  15. #define kMinJudgeVal    -30000
  16.  
  17.  
  18. short    FindBestBoard (BoardPtr board, BoardJudgeProc judgeboard, short player, MovePtr move, short level, PruneJudgeProc judgeprune, short alfa, short beta);
  19. short    FindBestMove (BoardPtr board, MoveJudgeProc judgeboard, short player, MovePtr move, short level, short alfa, short beta);
  20. //    These functions iterate over all moves recursively,
  21. //    to determine the best move for a given strategy.
  22. //    They use a standard minimax search algorithm with alfa-beta pruning.
  23.  
  24. short    FindGoodBoard (BoardPtr board, BoardJudgeProc judgeboard, short player, MovePtr move, short level, PruneJudgeProc judgeprune, short alfa, short beta);
  25. short    FindNiceBoard (BoardPtr board, BoardJudgeProc judgeboard, short player, MovePtr move, short level);
  26. //    Special case of the above.
  27.  
  28. short    GenerateMoves (BoardPtr board, BoardJudgeProc judgeboard, short player, short level);
  29. //    Generate all valid moves, compute the corresponding board values
  30. //    and store the result in a global array.
  31. //    The actual number of valid moves is returned.
  32.  
  33. void    SortMoves (short n_moves);
  34. int        CompareEvals (const void *e1, const void *e2);
  35.  
  36. #endif
  37.  
  38. #ifdef COMPUTE_C
  39.  
  40. #include "Game.h"
  41. #include "Global.h"
  42. #include "Interface.h"
  43. #include "Settings.h"
  44.  
  45. #include <StdLib.h>        //    qsort, malloc
  46. #include <String.h>        //    memcpy
  47.  
  48. Boolean    AlfaBeta (short player, short value, short *minSoFar, short *maxSoFar, short *alfa, short *beta);
  49. //Boolean    PlayerHasBallOnOuterRing (BoardPtr board, short player);
  50.  
  51. #endif
  52.  
  53.